<%--
  Created by IntelliJ IDEA.
  User: Faroe
  Date: 17/5/9
  Time: 下午6:11
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path;
%><html>
<head>
    <meta charset="UTF-8">
    <title>编辑商品</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>





</head>
<body class="skin-blue">
<!-- getHeader -->
<s:action name="getHeader" namespace="/privilege" executeResult="true"/>
<div class="wrapper row-offcanvas row-offcanvas-left">
    <!-- Left side column. contains the logo and sidebar -->

    <!-- getMenus -->
    <s:action name="getMenus" namespace="/privilege" executeResult="true"/>

    <!-- Right side column. Contains the navbar and content of the page -->
    <aside class="right-side">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                <small>编辑商品</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                <li><a href="#">Tables</a></li>
                <li class="active">Data tables</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">

            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box box-danger">
                            <div class="box-body">
                                <form action="<%=basePath%>/common/ajaxEditGoods.action" class="form-inline" name="searchForm">
                                    <input type="text" name="recid" class="input-small" id="inpu" hidden>

                                    <lable>商品序号</lable>
                                    <input type="text"  name="goodsid" class="input-small" id="input1">
                                    <br><br>
                                    <lable>商品标识</lable>
                                    <input type="text"  name="goodsIdno" class="input-small" id="input2">
                                    <br><br>
                                    <lable>商品名称</lable>
                                    <input type="text"  name="goodsName" class="input-small" id="input3">
                                    <br><br>
                                    <lable>商品价格</lable>
                                    <input type="text"  name="chargeQuantity" class="input-small" id="input4">
                                    <br>
                                    <br>
                                    <button type="submit" class="btn">保存</button>
                                </form>
                            </div>
                            <!-- /.box-body -->
                        </div><!-- /.box -->


                        <!-- 文章列表 -->
                        <form method="post" target="_self" action="" name="listForm">
                            <div class="box-body table-responsive" id="listDiv">
                                <s:property value="res" escape="false"/>
                            </div><!-- /.box-body -->
                        </form>
                    </div><!-- /.box -->
                </div>
            </div>
        </section><!-- /.content -->
    </aside><!-- /.right-side -->
</div><!-- ./wrapper -->


<script>
    var url = window.location.href;
    var index=url.indexOf(("?"));
    var subStr=url.substring(index+1);
    var arrayTemp=new Array();
    arrayTemp=subStr.split('&');


    var idArray=new Array();
    idArray=arrayTemp[0].split('=');
    if (idArray[0] ==="id") {
        document.getElementById("input1").value = idArray[1];
    }

    var idnoArray=new  Array();
    idnoArray=arrayTemp[1].split('=');
    if (idnoArray[0]==="idno"){
        document.getElementById("input2").value = idnoArray[1];
    }

    var nameArray=new  Array();
    nameArray=arrayTemp[2].split('=');
    if (nameArray[0]==="name"){
        document.getElementById("input3").value = decodeURI(nameArray[1]);
    }

    var chargeArray=new  Array();
    chargeArray=arrayTemp[3].split('=');
    if (chargeArray[0]==="charge"){
        document.getElementById("input4").value = chargeArray[1];
    }


    var recArray=new Array();
    recArray=arrayTemp[4].split('=');
    if (recArray[0] ==="rId") {
        document.getElementById("inpu").value = recArray[1];
    }
</script>
</body>
</html>
